#-*- coding: utf-8 -*-
import socket
print "Creating socket"
t = socket.create_connection(("192.168.1.115", 8888), source_address=("192.168.1.115", 18290))
print "Done!"
print t
print "Connected from", t.getsockname()  #获得本地机器的ip和端口号（端口号由操作系统随机分配，每次都不一样）
print "Connected to", t.getpeername()    #获得连接机器的ip和端口号